# 作业1：
# url：https://www.lntcm.com.cn/
# 用例1：
# 搜索骨科—>点击搜索—>点击出来的第一个链接—>断言文本内容
# from selenium import webdriver
# from selenium.webdriver.common.by import By
# from selenium.webdriver.support import expected_conditions as EC
# from selenium.webdriver.support.ui import WebDriverWait
# import time

# diver = webdriver.Chrome()
# diver.get('https://www.lntcm.com.cn/')
# diver.maximize_window()
# diver.find_element(By.ID,'showkeycode256695').send_keys('骨科')
# time.sleep(3)
#
# diver.find_element(By.CLASS_NAME,'sst').click()
# time.sleep(3)
#
# diver.find_element(By.XPATH,'/html/body/div[3]/div/div/div[2]/div[2]/ul/li[1]/a').click()
# time.sleep(3)
#
# text = diver.find_element(By.CLASS_NAME,'lbp').text
# assert text == '喜讯'
# time.sleep(10)
# 作业2：
# 1、打开百度：https://www.baidu.com/，输入：刘超班长，点击搜索
# driver = webdriver.Chrome()
# driver.get('https://www.baidu.com/')
# driver.maximize_window()
# driver.find_element(By.ID,'chat-textarea').send_keys('刘超班长')
# time.sleep(3)
#
# driver.find_element(By.ID,'chat-submit-button').click()
# time.sleep(3)
# driver.find_element(By.XPATH,'//*[@id="2"]/div/div/h3/a').click()
# win = driver.window_handles
# driver.switch_to.window(win[-1])
# time.sleep(3)
# text = driver.find_element(By.CLASS_NAME,'lemmaDescText_yvHjG').text
# assert text == '战斗英雄'
# # 4、点击：文章中的东北野战军链接
# driver.find_elements(By.CLASS_NAME ,'innerLink_dFNtB')[0].click()
# time.sleep(5)
# win = driver.window_handles
# driver.switch_to.window(win[-1])
# # 5、断言：中国人民解放军第四野战军，是否正确
# driver.find_element(By.CLASS_NAME,'lemmaTitle_mNKG_').click()
# time.sleep(3)
# # 6、在上方词条清空，输入：刘能，点击进入词条
# inputs = driver.find_elements(By.CLASS_NAME,'searchInput')[0]
# inputs.clear()      # 清空文本内容
# time.sleep(3)
# inputs.send_keys('刘能')
# time.sleep(3)
# driver.find_elements(By.CLASS_NAME,'lemmaBtn')[0].click()
# time.sleep(3)
#
# # 7、断言当前页面，是否进入正确，分文章内容
# text= driver.find_element(By.CLASS_NAME,'lemmaDescText_yvHjG').text
# assert text=='电视剧《乡村爱情》系列中的重要角色'
# # 8、点击文章中的：乡村爱情
# driver.find_element(By.XPATH,'//*[@id="J-lemma-main-wrapper"]/div[2]/div/div[1]/div/div[2]/div[1]/span[2]/a').click()
# win = driver.window_handles
# driver.switch_to.window(win[-1])
# time.sleep(3)
#
# # 9、断言当前页面，是否进入正确，分文章内容
# text=driver.find_element(By.CLASS_NAME,'lemmaTitle_mNKG_').text
# assert text=='乡村爱情'
# # 10、点击导演：张慧中
# driver.find_element(By.XPATH,'//*[@id="J-lemma-main-wrapper"]/div[1]/div[2]/div/div[1]/div[3]/div[1]/div/div[1]/div[2]/span[1]/a').click()
# time.sleep(3)
# win = driver.window_handles
# driver.switch_to.window(win[-1])
# # 11、点击文章中的：法库县
# driver.find_element(By.XPATH,'//*[@id="J-lemma-main-wrapper"]/div[2]/div/div[1]/div/div[3]/div[1]/span[2]/a').click()
# time.sleep(3)
# # 12、断言当前页面，是否进入正确，分文章内容
# text=driver.find_element(By.CLASS_NAME,'lemmaTitle_mNKG_').text
# assert text=='张惠中'

time.sleep(10)